package de.au.fi.domain;

import java.lang.reflect.Method;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;



public class StockIdMappingHelper {
	
	static Logger log = LoggerFactory.getLogger(EntityHelper.class);
	
	public static StockIdMapping getStockIdMapping(Stock stock, List<String> data)
	{
		StockIdMapping stockIdMapping = new StockIdMapping();
		stockIdMapping.setTickerYahooData(stock.getTicker());
		stockIdMapping.setTickerYahooFinance(data.get(1));
		stockIdMapping.setIsin(data.get(0));
		stockIdMapping.setWkn(stock.getWkn());
		stockIdMapping.setOnVistaId(stock.getOnVistaId());
		stockIdMapping.setName(stock.getName());
	
		return stockIdMapping;
	}
	
	public static Stock mapStockIdMappingToStock(Stock stock, StockIdMapping stockIdMapping)
	{
		stock.setTicker(stockIdMapping.getTickerYahooData());
		stock.setIsin(stockIdMapping.getIsin());
		stock.setWkn(stock.getWkn());
		stock.setOnVistaId(stock.getOnVistaId());
		stock.setName(stock.getName());
	
		return stock;
	}
}
